package com.bjsxt;

import java.awt.*;

/**
 * @Project: PlaneFight
 * @Author: 陈祖生
 * @Version: 1.0
 * @CreateTime: 2022/7/2 10:56
 * @Description: PlaneFight
 */
public class Explode {
    double x,y;
    static Image[] imgs = new Image[16];

    static {
        for (int i = 0; i < 16; i++) {
            imgs[i] = GameUtil.getImage("images/explode/e"+(i+1)+".gif");
            //懒加载
//            imgs[i].getWidth(null);
        }
    }

    int count;
    boolean live = true;
    public void draw(Graphics g){
        if(!live){
            return;
        }

        if(count <16){
            g.drawImage(imgs[count],(int)x,(int)y,null);
            count++;
        }
    }

    public Explode(double x, double y) {
        this.x = x;
        this.y = y;
    }
}
